<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>局部组件</title>
</head>
<script>
    /*
        局部组件  需要通过components选项注册尽在当前
        实例中可用的组件

    */
</script>

<body>
    <div id="app">
        库房还剩<buttoncounter></buttoncounter>>
    </div>

    <script src="https://unpkg.com/vue@next"></script>
    <script>
        const MyComponent = {
            data(){
                return{
                    num:1000
                }
            },
            template:
            `<button v-on:click="num--">{{num}}</button>`
        }

        const vm =  Vue.createApp({
            components:{
                buttoncounter:MyComponent  //局部组件
            }
        })
         vm.mount('#app')
    </script>
</body>

</html>
